package _220324;

import java.util.Scanner;

/**
 * @author ShadowLim
 * @create 2022-03-24-12:48
 */
public class 距离和 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = "LANQIAO";
        int sum = 0;
        for (int i = 0; i < s.length(); i++) {
            for (int j = i; j < s.length(); j++) {
                sum += Math.abs(s.charAt(i) - s.charAt(j));
            }
        }
        System.out.println(sum);
    }
}
